<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 如果是想把script标签放在header里面，使用onload ，页面加载完成时执行js代码，否则 btn对象为null
        window.onload = function () {
            var btn = document.getElementById("btn");
            btn.innerHTML = "我是按钮123"

            var inputs = document.getElementsByName("city");
            inputs.forEach(element => {
                // console.log(element.innerHTML);   input标签是自结束标签， 无innerHTML
                console.log(element.value);
            });
        }
    </script>

</head>

<body>
    <div>
        <button id="btn">按钮</button>
        武汉
        <input type="radio" name="city" value="wh" />
        深圳
        <input type="radio" name="city" value="sz" />
    </div>
</body>

</html>